package com.lifecycle;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.util.component.AbstractLifeCycle;

public class NewHandler extends AbstractLifeCycle implements Handler
{
	private Server _server;
	
	@Override
	public void handle(String target, Request baseRequest,
			HttpServletRequest request, HttpServletResponse response)
			throws IOException, ServletException {
		// TODO Auto-generated method stub
		System.err.println( "进入 handler 方法" );
	}

	@Override
	public void setServer(Server server) {
		 if (_server==server)
	            return;
	        if (isStarted())
	            throw new IllegalStateException(STARTED);
	        _server=server;
	}

	@Override
	public Server getServer() {
		// TODO Auto-generated method stub
		return _server;
	}

	@Override
	public void destroy() {}
	
}